package com.zyk.scaffold.shardingsphere.rw.business.read.controller;

import com.zyk.scaffold.core.domain.Result;
import com.zyk.scaffold.shardingsphere.rw.repositorys.entity.TAddress;
import com.zyk.scaffold.shardingsphere.rw.repositorys.interfaces.TAddressRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/read")
public class ReadController {

    @Autowired
    private TAddressRepository tAddressRepository;

    @PostMapping("/list")
    public Result<List<TAddress>> list(){
        return Result.ok(tAddressRepository.list());
    }
}
